from util.file_encryption import encrypt_model
from util.update_encryption import update_IV,update_x1_model
from util.rebuild_nativlibs import run_gradle_rebuild,copy_so_2_x1,copy_model_2_x1
from Config import AppConfig
import time
# iv = encrypt_model(AppConfig.model_path,AppConfig.encrypted_model_path)
# update_IV(iv)
success = run_gradle_rebuild(AppConfig.nativelibs_project_path)
if success:
    print(" rebuild success")
else:
    print(" rebuild fail")
# 等待
time.sleep(1)
copy_so_2_x1(AppConfig.nativelibs_project_path,AppConfig.x1_project_path)
update_x1_model(AppConfig.x1_project_path,"QRv3_pred_best_quantized_prepared_qcs8550.dll")
copy_model_2_x1(r"D:/data/code/client/decoder_file/backup\model/QRv3_pred_best_quantized_prepared_qcs8550.dll",AppConfig.x1_project_path)